import request from '../utils/request'

// 手机登录
export const loginByPhone = (data) => {
  return request({
    method: 'post',
    url: '/login/cellphone',
    data
  })
}
// 邮箱登录
export const loginByEmail = (data) => {
  return request({
    method: 'post',
    url: '/login',
    data
  })
}
// 二维码登录 key生成
export const getQrKey = () => {
  return request({
    url: '/login/qr/key'
  })
}
// 二维码生成
export const createQr = (params) => {
  params.qrimg = +new Date()
  return request({
    url: '/login/qr/create',
    params
  })
}
// 二维码检测扫码状态接口
export const checkQr = (params) => {
  return request({
    url: '/login/qr/check',
    params
  })
}
// 获取登录状态
export const getLoginStatus = () => {
  return request({
    url: '/login/status'
  })
}

// 搜索用户名
export const searchUser = (params) => {
  return request({
    url: '/search',
    params
  })
}
